package com.tjsiqi.controller;

import com.tjsiqi.beans.PageQuery;
import com.tjsiqi.common.JsonData;
import com.tjsiqi.param.WeighCountParam;
import com.tjsiqi.param.WeighCountParamM;
import com.tjsiqi.service.SysDeptService;
import com.tjsiqi.service.SysWeighCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;


@Controller
@RequestMapping("/sys/WeighCount")
public class SysWeightCountController {
    @Autowired
    private SysWeighCountService sysWeighCountService;

    @RequestMapping("/WeighCount.page")
    public ModelAndView WeighCountPage(){
        return new ModelAndView("WeighRecordCount");
    }

    //生产厂家页面
    @RequestMapping("/ProvideUnit.page")
    public ModelAndView ProvideUnitPage(){
        return new ModelAndView("ProvideUnit");
    }

    //车牌号页面
    @RequestMapping("/WeightTruck.page")
    public ModelAndView WeightTruckPage(){
        return new ModelAndView("WeightTruck");
    }

    //搅拌站 材料名称页面
    @RequestMapping("/WeightGoodsName.page")
    public ModelAndView WeightGoodsNamePage(){
        return new ModelAndView("WeightGoodsName");
    }

    //搅拌站 供货商页面
    @RequestMapping("/WeightSendUnit.page")
    public ModelAndView WeightSendUnitPage(){
        return new ModelAndView("WeightSendUnit");
    }


    //按客户
    @RequestMapping("/ProUnitPage.json")
    @ResponseBody
    public JsonData getWeighCountByCustomer(WeighCountParam weighCountParam, PageQuery page){

        return JsonData.success(sysWeighCountService.getWeighCountByProUnit(weighCountParam,page));
    }

    //按车牌号
    @RequestMapping("/TruckPage.json")
    @ResponseBody
    public JsonData getWeighCountByTruck(WeighCountParam weighCountParam, PageQuery page){

        return JsonData.success(sysWeighCountService.getWeighCountByTruck(weighCountParam,page));
    }

    //按存放位置
    @RequestMapping("/StoragePage.json")
    @ResponseBody
    public JsonData getWeighCountByStorage(WeighCountParam weighCountParam, PageQuery page){

        return JsonData.success(sysWeighCountService.getWeighCountByStorage(weighCountParam,page));
    }

    //按货物名称
    @RequestMapping("/NamePage.json")
    @ResponseBody
    public JsonData getWeighCountByName(WeighCountParam weighCountParam, PageQuery page){

        return JsonData.success(sysWeighCountService.getWeighCountByName(weighCountParam,page));
    }

    //管理员查询生产厂家
    @RequestMapping("/ProvideUnit.json")
    @ResponseBody
    public JsonData getWeighCountByProvideUnit(WeighCountParamM weighCountParamM, PageQuery page){
        return JsonData.success(sysWeighCountService.getWeighCountByProvideUnit(weighCountParamM,page));
    }

    //管理员查询车牌号
    @RequestMapping("/WeightTruck.json")
    @ResponseBody
    public JsonData getWeighCountByWeightTruck(WeighCountParamM weighCountParamM, PageQuery page){
        return JsonData.success(sysWeighCountService.getWeighCountByWeightTruck(weighCountParamM,page));
    }

    //管理员查询材料名称
    @RequestMapping("/WeightGoodsName.json")
    @ResponseBody
    public JsonData getWeighCountByWeightGoodsName(WeighCountParamM weighCountParamM, PageQuery page){
        return JsonData.success(sysWeighCountService.getWeighCountByWeightGoodsName(weighCountParamM,page));
    }

    //管理员查询供货商
    @RequestMapping("/WeightSendUnit.json")
    @ResponseBody
    public JsonData getWeighCountByWeightSendUnit(WeighCountParamM weighCountParamM, PageQuery page){
        return JsonData.success(sysWeighCountService.getWeighCountByWeightSendUnit(weighCountParamM,page));
    }


}
